<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>AmpleHarvest: cRequestNotification.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">AmpleHarvest
   &#160;<span id="projectnumber">0.0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group_2c_request_notification_8php.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">cRequestNotification.php</div>  </div>
</div>
<div class="contents">
<a href="group_2c_request_notification_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a><a class="code" href="namespaceampleharvest_1_1email_1_1group.html">00002</a>         <span class="keyword">namespace </span>ampleharvest\email\group;
<a name="l00003"></a>00003         use\ampleharvest\code\usermanager\tables;
<a name="l00008"></a>00008         require_once dirname(dirname(dirname(dirname(__FILE__)))) . <span class="stringliteral">&#39;/config/cConfig.php&#39;</span>;
<a name="l00009"></a>00009         require_once dirname(dirname(__FILE__)) . <span class="stringliteral">&quot;/cMailNotification.php&quot;</span>;
<a name="l00010"></a>00010         require_once dirname(dirname(dirname(__FILE__))) . <span class="stringliteral">&quot;/User_Manager/Tables/cTABLE_Groups.php&quot;</span>;
<a name="l00011"></a>00011         require_once dirname(dirname(dirname(__FILE__))) . <span class="stringliteral">&quot;/Tables/cTABLE_UserGroups.php&quot;</span>;
<a name="l00012"></a>00012         require_once dirname(dirname(dirname(__FILE__))) . <span class="stringliteral">&quot;/classification/cMarkings.php&quot;</span>;
<a name="l00013"></a>00013         require_once \ampleharvest\code\cConfig::C_STR_USER_MANAGER_PATH . <span class="stringliteral">&quot;/Classes/cTABLE_Users.php&quot;</span>;
<a name="l00014"></a>00014         require_once \ampleharvest\code\cConfig::C_STR_USER_MANAGER_PATH . <span class="stringliteral">&quot;/Classes/cTABLE_Users2Groups.php&quot;</span>;
<a name="l00015"></a>00015 
<a name="l00029"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html">00029</a>         <span class="keyword">class </span><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html" title="Class Extends the cMailNotification Class and is used to send notifictions about Queries.">cRequestNotification</a> <span class="keyword">extends</span> \<a class="code" href="classc_mail_notification.html" title="Class to handle sending Email notifications.">cMailNotification</a>
<a name="l00030"></a>00030         {
<a name="l00031"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#a57bcdaf0dd68d86ec06d0e5e4f82ec96">00031</a>                 <span class="keyword">protected</span> $m_str_GroupID = null;
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#a3ed63846eb8659d3d1ca95cc2b9e2b81">00033</a>                 <span class="keyword">protected</span> <a class="code" href="classc_request_notification.html#a3ed63846eb8659d3d1ca95cc2b9e2b81">$m_obj_TABLE_Users</a> = null;
<a name="l00034"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#a74c3a399baafa433d77cd2d9762ec40c">00034</a>                 <span class="keyword">protected</span> <a class="code" href="classc_request_notification.html#a74c3a399baafa433d77cd2d9762ec40c">$m_obj_TABLE_Users2Groups</a> = null;
<a name="l00035"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#a4afe3de6d2a2fdc7d57ed426b6f8941e">00035</a>                 <span class="keyword">protected</span> $m_obj_TABLE_User_Groups = null;
<a name="l00036"></a>00036 
<a name="l00037"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#a095c5d389db211932136b53f25f39685">00037</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_request_notification.html#a095c5d389db211932136b53f25f39685">__construct</a>()
<a name="l00038"></a>00038                 {
<a name="l00039"></a>00039                         $this-&gt;m_obj_TABLE_Users = new \cTABLE_Users();
<a name="l00040"></a>00040                         $this-&gt;m_obj_TABLE_Users2Groups = new \cTABLE_Users2Groups();
<a name="l00041"></a>00041                         $this-&gt;m_obj_TABLE_User_Groups = new \cTABLE_UserGroups();
<a name="l00042"></a>00042                 }
<a name="l00043"></a>00043 
<a name="l00048"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#ac49c4541f5faa19f9b09465345a1c7e4">00048</a>                 <span class="keyword">public</span> <span class="keyword">function</span> set_GroupID(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00049"></a>00049                 {
<a name="l00050"></a>00050                         $this-&gt;m_str_GroupID = <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>;
<a name="l00051"></a>00051                 }
<a name="l00052"></a>00052 
<a name="l00053"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#a12bcef5130168b80d3d52dc82213f19a">00053</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_mail_notification.html#a12bcef5130168b80d3d52dc82213f19a" title="Sends the Email to STOMP QUEue.">send</a>()
<a name="l00054"></a>00054                 {
<a name="l00055"></a>00055                         <span class="keywordflow">if</span> (!$this-&gt;m_obj_TABLE_User_Groups-&gt;load_DataFromID($this-&gt;m_str_GroupID))
<a name="l00056"></a>00056                         {
<a name="l00057"></a>00057                                 $this-&gt;<a class="code" href="classc_mail_notification.html#ae0aeef2e4fe928100c40c8e413ea3a82">set_Error</a>($this-&gt;m_str_GroupID . <span class="stringliteral">&quot;is an unknown ID.&quot;</span>);
<a name="l00058"></a>00058                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00059"></a>00059                         }
<a name="l00060"></a>00060 
<a name="l00061"></a>00061                         <span class="keywordflow">foreach</span> ($this-&gt;m_obj_TABLE_Users2Groups-&gt;get_MembersAsArray(tables\cTABLE_Groups::C_STR_GROUP_AH_GROUP_ADMIN) as $str_UserID)
<a name="l00062"></a>00062                         {
<a name="l00063"></a>00063                                 <span class="keywordflow">if</span> ($this-&gt;m_obj_TABLE_Users-&gt;load_DataFromUserID($str_UserID))
<a name="l00064"></a>00064                                 {
<a name="l00065"></a>00065                                         $str_Email = $this-&gt;m_obj_TABLE_Users-&gt;get_Email1();
<a name="l00066"></a>00066                                         <span class="keywordflow">if</span> ($str_Email)
<a name="l00067"></a>00067                                         {
<a name="l00068"></a>00068                                                 $this-&gt;<a class="code" href="classc_mail_notification.html#a1fb929599bf3a05e34aec500ca604f2e" title="This function will add a TO address.">add_To</a>($this-&gt;m_obj_TABLE_Users-&gt;get_Email1());
<a name="l00069"></a>00069                                         }
<a name="l00070"></a>00070                                 }
<a name="l00071"></a>00071                         }
<a name="l00072"></a>00072 
<a name="l00073"></a>00073                         $this-&gt;m_obj_TABLE_Users-&gt;load_DataFromUserID($this-&gt;m_obj_TABLE_User_Groups-&gt;get_requester());
<a name="l00074"></a>00074                         $str_Email = $this-&gt;m_obj_TABLE_Users-&gt;get_Email1();
<a name="l00075"></a>00075                         <span class="keywordflow">if</span> ($str_Email)
<a name="l00076"></a>00076                         {
<a name="l00077"></a>00077                                 $this-&gt;<a class="code" href="classc_mail_notification.html#a4326365ccd9a263987a28b05c81f2944" title="This function will add a TO address.">add_CC</a>($str_Email);
<a name="l00078"></a>00078                         }
<a name="l00079"></a>00079 
<a name="l00080"></a>00080                         $this-&gt;<a class="code" href="classc_mail_notification.html#a8ad0cbd4250509618c3b4c829f1b251b" title="Sets the Subject of the email.">set_Subject</a>(<span class="stringliteral">&quot;New Group Request&quot;</span>);
<a name="l00081"></a>00081 
<a name="l00082"></a>00082                         <span class="comment">//      $int_Errors = ini_get(&quot;display_errors&quot;);</span>
<a name="l00083"></a>00083                         <span class="comment">//      ini_set(&#39;display_errors&#39;, 0);</span>
<a name="l00084"></a>00084                         $bool_Return = <a class="code" href="classc_mail_notification.html#a12bcef5130168b80d3d52dc82213f19a" title="Sends the Email to STOMP QUEue.">parent::send</a>();
<a name="l00085"></a>00085 
<a name="l00086"></a>00086                         <span class="comment">//      ini_set(&#39;display_errors&#39;, $int_Errors);</span>
<a name="l00087"></a>00087 
<a name="l00088"></a>00088                         <span class="keywordflow">return</span> $bool_Return;
<a name="l00089"></a>00089                 }
<a name="l00090"></a>00090 
<a name="l00091"></a><a class="code" href="classampleharvest_1_1email_1_1group_1_1c_request_notification.html#ab82c92e2745c3e15a7028f770091c094">00091</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_request_notification.html#ab82c92e2745c3e15a7028f770091c094" title="Gets the content of the email.">get_Body</a>()
<a name="l00092"></a>00092                 {
<a name="l00093"></a>00093                         $str_Output = <span class="stringliteral">&quot;&quot;</span>;
<a name="l00094"></a>00094 
<a name="l00095"></a>00095                         $obj_Markings = new \cMarkings($this-&gt;m_obj_TABLE_User_Groups-&gt;get_classification(),
<a name="l00096"></a>00096                                 $this-&gt;m_obj_TABLE_User_Groups-&gt;get_sci(),
<a name="l00097"></a>00097                                 $this-&gt;m_obj_TABLE_User_Groups-&gt;get_distro());
<a name="l00098"></a>00098                                 
<a name="l00099"></a>00099                         $str_UserName = $this-&gt;m_obj_TABLE_User_Groups-&gt;get_requester();
<a name="l00100"></a>00100                                 
<a name="l00101"></a>00101                         <span class="keywordflow">if</span> ($this-&gt;m_obj_TABLE_Users-&gt;load_DataFromUserID($str_UserName))
<a name="l00102"></a>00102                                 {
<a name="l00103"></a>00103                                         $str_UserName = $this-&gt;m_obj_TABLE_Users-&gt;get_LastName();
<a name="l00104"></a>00104                                         $str_UserName .= <span class="stringliteral">&quot;, &quot;</span>.$this-&gt;m_obj_TABLE_Users-&gt;get_FirstName();
<a name="l00105"></a>00105                                         $str_UserName .= <span class="stringliteral">&quot; (&quot;</span>.$this-&gt;m_obj_TABLE_Users-&gt;get_UserName().<span class="stringliteral">&quot;)&quot;</span>;
<a name="l00106"></a>00106                                 }
<a name="l00107"></a>00107 
<a name="l00108"></a>00108                         $str_Output .= $obj_Markings-&gt;get_OverallEmailBanner();
<a name="l00109"></a>00109 
<a name="l00110"></a>00110                         $str_Output .= $str_UserName.<span class="stringliteral">&quot; Requested that the following group be created.\n&quot;</span>;
<a name="l00111"></a>00111                         
<a name="l00112"></a>00112                         $str_Output .= <span class="stringliteral">&quot;Group Name: &quot;</span>.$this-&gt;m_obj_TABLE_User_Groups-&gt;get_name().<span class="stringliteral">&quot;\n&quot;</span>;
<a name="l00113"></a>00113                         $str_Output .= <span class="stringliteral">&quot;Group Description: &quot;</span>.$this-&gt;m_obj_TABLE_User_Groups-&gt;get_description().<span class="stringliteral">&quot;\n&quot;</span>;
<a name="l00114"></a>00114                         $str_Output .= <span class="stringliteral">&quot;Group Justification: &quot;</span>.$this-&gt;m_obj_TABLE_User_Groups-&gt;get_justification().<span class="stringliteral">&quot;\n&quot;</span>;
<a name="l00115"></a>00115 
<a name="l00116"></a>00116                         $str_Output .= $obj_Markings-&gt;get_OverallEmailBanner();
<a name="l00117"></a>00117 
<a name="l00118"></a>00118                         <span class="keywordflow">return</span> $str_Output;
<a name="l00119"></a>00119                 }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121         }
<a name="l00122"></a>00122 ?&gt;
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="group_2c_request_notification_8php.html">cRequestNotification.php</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Mon Jan 23 2012 13:34:19 for AmpleHarvest by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
